package com.zhuanzhuan.hero.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhuanzhuan.hero.user.dto.auth.CommitAuthDTO;
import com.zhuanzhuan.hero.user.entity.HeroUserAuthentication;
import com.zhuanzhuan.hero.user.vo.auth.UserAuthDetailVO;
import com.zhuanzhuan.hero.user.vo.auth.UserAuthResultVO;
import com.zhuanzhuan.hero.user.vo.auth.UserAuthStateVO;

import java.util.List;

/**
 * dal Interface:HeroUserAuthentication
 * @author hanjunjun
 * @date 2024-6-17
 */
public interface HeroUserAuthenticationService extends IService<HeroUserAuthentication> {

    Long insertSelective(HeroUserAuthentication record);

    boolean updateByUid(Long uid, HeroUserAuthentication update);

    /**
     * 注册时初始化
     *
     * @param uid
     * @return java.lang.Long  主键id
     * @author  hanjunjun
     * @date 2024/6/17
     **/
    Long registInitUserAuthenticationInfo(Long uid);

    /**
     * 实人认证成功
     *
     * @param uid
     * @return boolean
     * @author  hanjunjun
     * @date 2024/6/27
     **/
    boolean realnameAuthSuccess(Long uid);

    /**
     * 企业认证成功
     *
     * @param uid
     * @return boolean
     * @author  hanjunjun
     * @date 2024/6/27
     **/
    boolean enterpriseAuthSuccess(Long uid);

    HeroUserAuthentication getByUid(Long uid);

    List<HeroUserAuthentication> listByUid(List<Long> uids);

    /**
     * 查询认证状态
     *
     * @param uid
     * @return java.util.List<com.zhuanzhuan.hero.user.vo.auth.UserAuthStateVO>
     * @author  hanjunjun
     * @date 2024/6/27
     **/
    List<UserAuthStateVO> queryUserAuthStates(Long uid);

    /**
     * 是否已实名认证
     *
     * @param uid
     * @return boolean
     * @author  hanjunjun
     * @date 2024/8/5
     **/
    Integer isRealnameAuth(Long uid);

    /**
     * 查询实人、企业认证详情
     *
     * @param uid
     * @param authType
     * @return com.zhuanzhuan.hero.user.vo.auth.UserAuthDetailVO
     * @author  hanjunjun
     * @date 2024/6/28
     **/
    UserAuthDetailVO queryUserAuthDetail(Long uid, Integer authType);

    /**
     * 提交认证
     *
     * @param uid
     * @param commitAuthDTO
     * @return com.zhuanzhuan.hero.user.vo.auth.UserAuthResultVO
     * @author  hanjunjun
     * @date 2024/6/28
     **/
    UserAuthResultVO commitUserAuth(Long uid, CommitAuthDTO commitAuthDTO);

    /**
     * 定时任务 查询保卖仓状态，如果已关站则取消认证状态
     *
     * @param
     * @return void
     * @author  hanjunjun
     * @date 2024/6/28
     **/
    void timedModifyBmWarehouseAuthState(int batchSize);

    /**
     * 定时任务 查询转转已验机2.0商户状态，如果查询不到则取消认证状态
     *
     * @param
     * @return void
     * @author  hanjunjun
     * @date 2024/6/28
     **/
    void timedModifyZhuanzhuanMerchantAuthState(int batchSize);

    boolean delByUid(Long uid);
}